/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utt.edu.com.Controlador;

import java.sql.*;

/**
 *
 * @author Jesus Santiago
 */
public class CtrlConexionBaseDeDatos {

    private Connection con;

    public Connection conectarBD() {

        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=PERSONA;user=sa;password=1234;");
            return con;

        } catch (SQLException sqlException) {
            System.out.println(sqlException.getMessage() + "Error en la Base de Datos");
            return null;
        } catch (ClassNotFoundException classNotFound) {

            System.out.println(classNotFound.getMessage() + "Error, No se ha encontrado el Driver");
            return null;
        }
    }
}
